/*
 * @Author: Aaron
 * @Date: 2022-05-05 15:43:25
 * @LastEditors: yanMeng
 * @LastEditTime: 2022-07-19 17:50:54
 * @Description: file content
 * @FilePath: \ias_ui\src\views\JDSupermarket\js\theadList.js
 * @Company: 沃尔玛
 */

import { enumerationUpcStatus } from './dictionary.js'

/**
 * 商品列表
 */
export const productsListHeader = (isEdit) => {
  const arr = [
    {
      name: '京东商品编号',
      value: 'jdSkuId',
      minWidth: '100'
    },
    {
      name: 'UPC(不含检验码)',
      value: 'upc',
      minWidth: '130'
    },
    {
      name: '商品名称',
      value: 'skuName',
      minWidth: '100'
    },
    {
      name: '部门',
      value: 'deptNbr',
      minWidth: '80'
    },
    {
      name: 'Fineline',
      value: 'finelineNbr',
      minWidth: '100'
    },
    {
      name: '已报价店数',
      value: 'storeCount',
      minWidth: '100'
    },
    {
      name: '含税成本(仅供参考)',
      value: 'fixedCostPrice',
      minWidth: '150'
    },
    {
      name: '最高报价',
      value: 'sellingPriceMax',
      minWidth: '100'
    },
    {
      name: '最低报价',
      value: 'sellingPriceMin',
      minWidth: '100'
    },
    {
      name: '状态',
      value: 'upcStatus',
      minWidth: '100',
      slot: 'upcStatus'
    },
    {
      name: '更新人',
      value: 'updatedBy',
      minWidth: '100'
    },
    {
      name: '更新时间',
      value: 'updatedTime',
      minWidth: '100'
    },
    {
      name: '操作',
      width: '110',
      fixed: 'right',
      btnList: [
        {
          text: '详情',
          on: 'viewDetails',
          choose: {
            value: ['upcStatus'],
            upcStatus: [enumerationUpcStatus.TAKEEFFECT]
          }
        }
      ]
    }
  ]
  const item = {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  }
  if (isEdit) arr.unshift(item)
  return arr
}

/**
 * 导入报价校验数据列表
 */
export const productsOfferListHeader = [
  {
    name: '行号',
    value: 'rowNbr',
    minWidth: '60'
  },
  {
    name: '报价区域',
    value: 'regonName',
    minWidth: '100'
  },
  {
    name: '京东商品编号',
    value: 'jdSkuId',
    minWidth: '100'
  },
  {
    name: 'UPC(不含检验码)',
    value: 'upc',
    minWidth: '130'
  },
  {
    name: '商品名称',
    value: 'goodsName',
    minWidth: '100'
  },
  {
    name: '京超报价',
    value: 'sellingPrice',
    minWidth: '100'
  },
  {
    name: '校验状态',
    value: 'checkStatus',
    minWidth: '100',
    slot: 'checkStatus'
  },
  {
    name: '校验错误描述',
    value: 'errorMsg',
    minWidth: '130'
  },
  {
    name: '校验提示描述',
    value: 'promptMsg',
    minWidth: '130'
  }
]

/**
 * 商品详情店铺报价列表
 */
export const productDetailsListHeader = (isEdit) => {
  const item = {
    text: '删除报价',
    on: 'delOffer',
    type: 'danger',
    choose: {
      value: ['upcStatus'],
      upcStatus: [enumerationUpcStatus.TAKEEFFECT]
    }
  }
  const arr = [item]

  const arr1 = {
    type: 'selection',
    name: '复选框',
    value: 'selection',
    width: '40',
    minWidth: '110',
    fixed: 'left'
  }

  const arr2 = {
    name: '操作',
    width: '120',
    fixed: 'right',
    btnList: [
      ...arr
      // {
      //   text: '日志',
      //   on: 'operationLog',
      //   type: 'primary'
      // }
    ]
  }

  const herderList = [
    {
      name: '店号',
      value: 'storeNbr',
      minWidth: '60'
    },
    {
      name: '省份',
      value: 'provinceCn',
      minWidth: '60'
    },
    {
      name: '城市',
      value: 'cityCn',
      minWidth: '60'
    },
    {
      name: '门店简称',
      value: 'storeShortCn',
      minWidth: '160'
    },
    {
      name: '京东商品编号',
      value: 'jdSkuId',
      minWidth: '120'
    },
    {
      name: '京超报价/元',
      value: 'sellingPrice',
      minWidth: '80'
    },
    {
      name: '状态',
      value: 'upcStatus',
      minWidth: '60',
      slot: 'upcStatus'
    },
    {
      name: '更新人',
      value: 'updatedBy',
      minWidth: '80'
    },
    {
      name: '更新时间',
      value: 'updatedTime',
      minWidth: '80'
    }
  ]
  if (isEdit) {
    herderList.unshift(arr1)
    herderList.push(arr2)
  }
  return herderList
}

/**
 * 操作日志
 */
export const operationLogTableHeader = [
  {
    name: 'UPC(不带校验)',
    value: 'upc',
    minWidth: '120'
  },
  {
    name: '门店号',
    value: 'storeNbr',
    minWidth: '80'
  },
  {
    name: '操作时间',
    value: 'createdTime',
    minWidth: '120'
  },
  {
    name: '操作人',
    value: 'createdBy',
    minWidth: '120'
  },
  {
    name: '操作内容',
    value: 'operationTypeName',
    minWidth: '80'
  },
  {
    name: '备注',
    value: 'remark',
    minWidth: '120',
    slot: 'remark'
  }
]
